<?php
	include("includes/connect.php");
	include("includes/function.php");

	$db = new myDBS;
	$sql= "SELECT MAX(xxx_id) AS max_xxx_id FROM temp_creditor";
	
	$result = $db->runSQL($sql);

	$rows = $db->fetch_object ( $result );

	$max_xxx_id = $rows->max_xxx_id+1;

	$sql="INSERT INTO temp_creditor(xxx_id) values($max_xxx_id)";
	$db->insData($sql);
?>

<input type="hidden" id="h_key" name="h_key" value="<?php echo $max_xxx_id; ?>">